<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Taken</title>
<LINK HREF="<?php echo base_url(); ?>assets/jquery-ui-1.8.16.custom/css/ui-lightness/jquery-ui-1.8.16.custom.css" REL="stylesheet" TYPE="text/css">
<script type="text/javascript" src="<?php echo base_url(); ?>assets/jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
	<script>
		$(function() {
			$("#yadayadadatepicker").datepicker({dateFormat: 'yy-mm-dd'});
		});
	</script>
</head>

<body>
<div id="wrapper">
    <ul>
 		<?php 
		if($this->uri->segment(2) != "editTaak"){
			echo form_open_multipart('taak/addTaak/client_id/'.$this->uri->segment(4));
			?> 
    		<li>beschrijving:<?php echo form_input('beschrijving', '', 'size = 20px'); ?></li>
     		<li>aantal_minuten:<?php echo form_input('aantal_minuten', '', 'size = 20px'); ?></li>
            <li>tijdstip:
            <?php
			$options = array();
					for($i=0; $i<24; $i++){
						if($i < 10){
							array_push($options, '0'.(string)$i);
						}
						else {
							array_push($options, (string)$i);	
						}
					}		
				echo form_dropdown('uur', $options, 0); 
				?>:<?php 
				$options2 = array();
				for($i=0; $i<6; $i++){
					if($i == 0)
					{
						array_push($options2, '0'.(string)$i);
					}
					else {
						array_push($options2, (string)$i.'0');	
					}
				}
						
				echo form_dropdown('minuten', $options2, 0); 
			?>			
			</li>
            <li>Date: <?php echo form_input('yadayadadatepicker', '', 'id = "yadayadadatepicker"'); ?></li>
       		<?php echo form_submit('Submit', 'Toevoegen', 'id="submit"'); 
		}else {
			if($this->uri->segment(8)===FALSE){
				echo form_open_multipart('taak/updateTaak/id/'.$this->uri->segment(4).'/client_id/'.$this->uri->segment(6));
			}
			else{
				echo form_open_multipart('taak/updateTaak/id/'.$this->uri->segment(4).'/client_id/'.$this->uri->segment(6).'/medewerker_id/'.$this->uri->segment(8));
			}
   			$rij = $query2->row(); 
			?>
    		<li>beschrijving:<?php echo form_input('beschrijving', $rij->beschrijving, 'size = 20px'); ?></li>
     		<li>aantal_minuten:<?php echo form_input('aantal_minuten', $rij->aantal_minuten, 'size = 20px'); ?></li>
            <li>tijdstip:
            <?php
				$uur = substr($rij->tijd, 0, 2);
				$options = array();
					for($i=0; $i<24; $i++){
						if($i < 10){
							array_push($options, '0'.(string)$i);
						}
						else {
							array_push($options, (string)$i);	
						}
					}
						
				echo form_dropdown('uur', $options, $uur); 
			?>:<?php 
				$min = substr($rij->tijd, 3, 1);
				$options2 = array();
				for($i=0; $i<6; $i++){
					if($i == 0)
					{
						array_push($options2, '0'.(string)$i);
					}
					else {
						array_push($options2, (string)$i.'0');	
					}
				}
						
				echo form_dropdown('minuten', $options2, $min); 
			?>	
            </li>
            <li>Date: <?php echo form_input('yadayadadatepicker', $rij->datum, 'id = "yadayadadatepicker"'); ?></li>
       		<?php echo form_submit('Submit', 'Wijzigen', 'id="submit"'); 
		}?>
    </ul>
</div>
</body>
</html>